package top.roadvast.pdshopping.service.impl;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.stereotype.Service;
import top.roadvast.pdshopping.bean.PdOrder;
import top.roadvast.pdshopping.mapper.OrderMapper;
import top.roadvast.pdshopping.service.OrderService;

import javax.annotation.Resource;

/**
 * @Author 郭泽鹏
 * @Date 2021/12/27 19:53
 * @Version 1.0
 * @Description
 */
@Service
public class OrderServiceImpl implements OrderService {
    @Resource
    AmqpTemplate amqpTemplate;
    @Resource
    OrderMapper orderMapper;

    @Override
    public void saveOrder(PdOrder order) {
//        //消费者02，模拟rabbitmq是否会合理地分发消息
//        try {
//            Thread.sleep(2000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        orderMapper.insert(order);
    }
}
